// compoents/mapController/mapController.js
// 引入SDK核心类
const app = getApp()
var QQMapWX = require('../../libs/qqmap-wx-jssdk.min');
// poi: { //根据自己data数据设置相应的地图中心坐标变量名称
//   latitude: latitude,
//   longitude: longitude
// }
// 实例化API核心类
var qqmapsdk = new QQMapWX({
  key: 'OEIBZ-4V76T-NZAXD-LH5UE-CHBW6-YHFB6' // 必填
});
//给当前位置刷新开启和关闭用的
Component({
  //监听顶部选择器的变化
  observers: {
    'selectTitle': function (newVal, oldVal) {
      if (newVal == '场馆') {
        this.setData({
          markers: markersDatas["场馆"],
          polyline: null
        })
      } else if (newVal == '园林') {
        this.setData({
          markers: markersDatas["园林"],
          polyline: null
        })
      } else if (newVal == '建筑楼') {
        this.setData({
          markers: markersDatas["建筑楼"],
          polyline: null
        })
      } else if (newVal == '学院') {
        this.setData({
          markers: markersDatas["学院"],
          polyline: null
        })
      } else if (newVal == '书院') {
        this.setData({
          markers: markersDatas["书院"],
          polyline: null
        })
      } else if (newVal == '餐饮') {
        this.setData({
          markers: markersDatas["餐饮"],
          polyline: null
        })
      } else if (newVal == '停车场') {
        this.setData({
          markers: markersDatas["停车场"],
          polyline: null
        })
      } else if (newVal == '其它服务') {
        this.setData({
          markers: markersDatas["其它服务"],
          polyline: null
        })
      } else if (newVal == '推荐路线') {
        //数据不刷新
        setTimeout(() => {
          this.setData({
            latitude: 24.6160,
            longitude: 118.0664,
            markers: markerRouterDatas[0].markersData,
            polyline: [{
              points: reRoute1,
              // color: '#FF0000DD',
              color: '#56CB62',
              width: 10,
              arrowLine: true
            }]
          })
        }, 100)
        this.reloadData()
      } else {
        wx.showModal({
          title: '',
          content: '地图异常',
        })
      }
    }
  },
  properties: {
    selectTitle: '推荐路线'
  },
  data: {
    //有无定位权限
    havePermission: false,
    // address: '厦门工学院孔子广场',
    //图书馆↓
    srcLat: 24.6153,
    srcLng: 118.065977,
    //怀德大厦↓
    dstLat: 24.636182,
    dstLng: 118.074036,
    //当前地址
    latitude: 24.616003,
    longitude: 118.066403,
    // 在地图上标出来↓
    markers: []
  },
  /**
   * 组件的方法列表
   */
  methods: {
    reloadData() {


    },
    //导航路线
    DirectionRoute(e) {
      wx.showLoading({
        title: 'Loading...',
      })
      //先判断有无定位权限 再选择更新当前地址
      if (!this.data.havePermission) {
        wx.getSetting({
          success: (res) => {
            if (res.authSetting['scope.userLocation']) {
              // 用户已经授权，可以调用获取位置的方法
              wx.getLocation({
                // type: 'wgs84',
                type: 'gcj02',
                // isHighAccuracy: true,
                success: (res) => {
                  this.setData({
                    havePermission: true,
                    latitude: res.latitude,
                    longitude: res.longitude
                  });
                  this.DirectionRouteTrue(e)
                },
                fail: (err) => {
                  console.error('获取位置信息失败', err);
                  wx.hideLoading()
                }
              });
            } else {
              // 用户未授权，提示用户开启授权
              wx.showModal({
                title: '提示',
                content: '需要获取您的位置信息，请在设置中开启位置权限',
                showCancel: false,
                success: (modalRes) => {
                  wx.hideLoading()
                  if (modalRes.confirm) {
                    // 引导用户打开设置页面
                    wx.openSetting({
                      success: (openRes) => {
                        if (openRes.authSetting['scope.userLocation']) {
                          // 用户在设置页面开启了位置权限，再次获取位置
                          wx.getLocation({
                            success: (locationRes) => {
                              console.log('获取位置成功：', locationRes);
                            },
                            fail: (locationErr) => {
                              console.log('获取位置失败：', locationErr);
                            }
                          });
                        }
                      }
                    });
                  }
                }
              });
            }
          }
        });
      } else {
        wx.getLocation({
          // type: 'wgs84',
          type: 'gcj02',
          // isHighAccuracy: true,
          success: (res) => {
            this.setData({
              havePermission: true,
              latitude: res.latitude,
              longitude: res.longitude
            });
            this.DirectionRouteTrue(e)
          },
          fail: (err) => {
            this.setData({
              havePermission: false
            })
          }
        });
      }



    },
    //开始导航逻辑
    DirectionRouteTrue(e) {
      let toLatitude
      let toLongtitude
      var _this = this
      // console.log(this.data.markers)
      for (let i = 0; i < _this.data.markers.length; i++) {
        const item = _this.data.markers[i];
        if (item['title'] === e.text) {
          toLatitude = item.latitude
          toLongtitude = item.longitude
        }
      }
      //调用距离计算接口
      qqmapsdk.direction({
        mode: 'walking', //可选值：'driving'（驾车）、'walking'（步行）、'bicycling'（骑行），不填默认：'driving',可不填
        //from参数不填默认当前地址 
        from: {
          latitude: _this.data.latitude,
          longitude: _this.data.longitude
        },
        to: {
          latitude: toLatitude,
          longitude: toLongtitude
        },
        success: function (res) {
          // console.log(res);
          var ret = res;
          var coors = ret.result.routes[0].polyline,
            pl = [];
          //坐标解压（返回的点串坐标，通过前向差分进行压缩）
          var kr = 1000000;
          for (var i = 2; i < coors.length; i++) {
            coors[i] = Number(coors[i - 2]) + Number(coors[i]) / kr;
          }
          //将解压后的坐标放入点串数组pl中
          for (var i = 0; i < coors.length; i += 2) {
            pl.push({
              latitude: coors[i],
              longitude: coors[i + 1]
            })
          }
          // console.log(pl)
          // wx.showModal({
          //   title: '',
          //   content: JSON.stringify(pl),
          //   complete: (res) => {
          //     if (res.cancel) {
          //     }
          //     if (res.confirm) {
          //     }
          //   }
          // })
          //设置polyline属性，将路线显示出来,将解压坐标第一个数据作为起点
          _this.setData({
            latitude: pl[0].latitude,
            longitude: pl[0].longitude,
            polyline: [{
              points: pl,
              // color: '#FF0000DD',
              color: '#56CB62',
              width: 10,
              arrowLine: true
            }]
          })
          // setTimeout(() => {
          //   _this.setData({
          //     srcLat: _this.data.latitude,
          //     srcLng: _this.data.longitude
          //   })
          //   if (true) {
          //     _this.DirectionRoute()
          //   }
          // }, 6000)
        },
        fail: function (error) {
          wx.hideLoading()
          console.error(error);
          wx.showModal({
            title: '',
            content: error.message,
            complete: (res) => {
              if (res.cancel) {

              }

              if (res.confirm) {

              }
            }
          })
        },
        complete: function (res) {
          // console.log(res);
          wx.hideLoading()
        }
      });
    },

    MarkersAll(e) {
      // console.log("map函数" + e)
      const lati = 24.61732761
      const long = 118.06866354421486
      this.setData({
        markers: [{
          id: 0,
          title: '图书馆',
          latitude: lati,
          longitude: long,
          iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
          width: 20,
          height: 20,
        }]
      })
      this.setData({
        latitude: lati,
        longitude: long, // 获取返回结果，放到markers及poi中，并在地图展示，
        poi: { //根据自己data数据设置相应的地图中心坐标变量名称
          latitude: lati,
          longitude: long,
        }
      });
    },
    //切换路线推荐
    changeRoute(str) {
      if (str == '精华路线') {
        this.setData({
          latitude: 24.616001,
          longitude: 118.0664001,
          markers: markerRouterDatas[0].markersData,
          polyline: [{
            points: reRoute1,
            // color: '#FF0000DD',
            color: '#56CB62',
            width: 10,
            arrowLine: true
          }]
        })
      } else if (str == '经典路线') {
        this.setData({
          latitude: 24.6160002,
          longitude: 118.066402,
          markers: markerRouterDatas[1].markersData,
          polyline: [{
            points: reRoute2,
            // color: '#FF0000DD',
            color: '#56CB62',
            width: 10,
            arrowLine: true
          }]
        })
      } else if (str == '深层路线') {
        this.setData({
          latitude: 24.616003,
          longitude: 118.066403,
          markers: markerRouterDatas[2].markersData,
          polyline: [{
            points: reRoute3,
            // color: '#FF0000DD',
            color: '#56CB62',
            width: 10,
            arrowLine: true
          }]
        })
      }
    }
  },
  created() {
    //定位我的地址
    wx.getLocation({
      // type: 'wgs84',
      type: 'gcj02',
      // isHighAccuracy: true,
      success: (res) => {
        this.setData({
          // latitude: res.latitude,
          // longitude: res.longitude
        });
      },
      fail: (err) => {
        this.setData({
          latitude: 24.6153,
          longitude: 118.065977
        });
        wx.openSetting({
          success: (openRes) => {
            if (openRes.authSetting['scope.userLocation']) {
              // 用户在设置页面开启了位置权限，再次获取位置
              wx.getLocation({
                success: (locationRes) => {
                  this.setData({
                    // latitude: locationRes.latitude,
                    // longitude: locationRes.longitude
                  });
                },
                fail: (locationErr) => {
                  console.log('获取位置失败：', locationErr);
                }
              });
            }
          }
        });
      }
    });
    // this.openLocationUpdate()
  }
})
//推荐路线的标点
var markerRouterDatas = [{
  markersData: [{
    id: 0,
    title: '图书馆',
    latitude: 24.6153,
    longitude: 118.06563,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20,
    callout: { //可根据需求是否展示经纬度
      content: '图书馆',
      color: '#000',
      display: 'ALWAYS'
    }
  }, {
    id: 1,
    title: '教育信息文化馆',
    latitude: 24.61539385,
    longitude: 118.0652902590318,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20,
    callout: { //可根据需求是否展示经纬度
      content: '教育信息文化馆',
      color: '#000',
      display: 'ALWAYS'
    }
  }, {
    id: 2,
    title: '体育馆',
    latitude: 24.613867,
    longitude: 118.06323,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20,
    callout: { //可根据需求是否展示经纬度
      content: '体育文化馆',
      color: '#000',
      display: 'ALWAYS'
    }
  }, {
    id: 3,
    title: '教育博物馆',
    latitude: 24.61688,
    longitude: 118.06535,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20,
    callout: { //可根据需求是否展示经纬度
      content: '教育博物馆',
      color: '#000',
      display: 'ALWAYS'
    }
  }, {
    id: 4,
    title: '弘本书馆',
    latitude: 24.615969,
    longitude: 118.06774,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20,
    callout: { //可根据需求是否展示经纬度
      content: '弘本书馆',
      color: '#000',
      display: 'ALWAYS'
    }
  }, {
    id: 5,
    title: '校史馆',
    latitude: 24.61702761,
    longitude: 118.06876354421486,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20,
    callout: { //可根据需求是否展示经纬度
      content: '校史馆',
      color: '#000',
      display: 'ALWAYS'
    }
  }, {
    id: 6,
    title: '德文厦门工学院马拉松博物馆',
    latitude: 24.61722761,
    longitude: 118.06906354421486,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20,
    callout: { //可根据需求是否展示经纬度
      content: '德文厦门工学院马拉松博物馆',
      color: '#000',
      display: 'ALWAYS'
    }
  }, {
    id: 7,
    title: '工程坊',
    latitude: 24.61869385,
    longitude: 118.0689902590318,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20,
    callout: { //可根据需求是否展示经纬度
      content: '工程坊',
      color: '#000',
      display: 'ALWAYS'
    }
  }, ]
}, { //wjl 第二个推荐路线
  markersData: [{
      id: 0,
      title: '图书馆',
      latitude: 24.6153,
      longitude: 118.06563,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '图书馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 1,
      title: '教育信息文化馆',
      latitude: 24.61539385,
      longitude: 118.0652902590318,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '教育信息文化馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 2,
      title: '体育文化馆',
      latitude: 24.613867,
      longitude: 118.06323,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '体育文化馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 3,
      title: '教育博物馆',
      latitude: 24.61688,
      longitude: 118.06535,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '教育博物馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 4,
      title: '弘本书馆',
      latitude: 24.615969,
      longitude: 118.06774,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '弘本书馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 5,
      title: '校史馆',
      latitude: 24.61702761,
      longitude: 118.06876354421486,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '校史馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 6,
      title: '德文厦门工学院马拉松博物馆',
      latitude: 24.61722761,
      longitude: 118.06906354421486,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '德文厦门工学院马拉松博物馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 7,
      title: '工程坊',
      latitude: 24.61869385,
      longitude: 118.0689902590318,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '工程坊',
        color: '#000',
        display: 'ALWAYS'
      },

    }, {
      id: 8,
      title: '颐膳堂',
      latitude: 24.61607,
      longitude: 118.06372,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '颐膳堂',
        color: '#000',
        display: 'ALWAYS'
      },

    }, {
      id: 9,
      title: '和膳堂',
      latitude: 24.61647,
      longitude: 118.06410,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '和膳堂',
        color: '#000',
        display: 'ALWAYS'
      },

    }, {
      id: 10,
      title: '怡心园',
      latitude: 24.61727,
      longitude: 118.07012,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '怡心园',
        color: '#000',
        display: 'ALWAYS'
      },

    }, {
      id: 11,
      title: '国际学术交流中心',
      latitude: 24.61795,
      longitude: 118.07143,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '国际学术交流中心',
        color: '#000',
        display: 'ALWAYS'
      },

    },
    {
      id: 12,
      title: '标准化考试中心',
      latitude: 24.61457,
      longitude: 118.06219,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '标准化考试中心',
        color: '#000',
        display: 'ALWAYS'
      },
    },
    {
      id: 13,
      title: '春山商店',
      latitude: 24.61506,
      longitude: 118.06179,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '春山商店',
        color: '#000',
        display: 'ALWAYS'
      },

    }
  ]
}, { //wjl 第三个推荐路线
  markersData: [{
      id: 0,
      title: '图书馆',
      latitude: 24.6153,
      longitude: 118.06563,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '图书馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 1,
      title: '教育信息文化馆',
      latitude: 24.61539385,
      longitude: 118.0652902590318,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '教育信息文化馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 2,
      title: '体育文化馆',
      latitude: 24.613867,
      longitude: 118.06323,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '体育文化馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 3,
      title: '教育博物馆',
      latitude: 24.61688,
      longitude: 118.06535,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '教育博物馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 4,
      title: '弘本书馆',
      latitude: 24.615969,
      longitude: 118.06774,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '弘本书馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 5,
      title: '校史馆',
      latitude: 24.61702761,
      longitude: 118.06876354421486,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '校史馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 6,
      title: '德文厦门工学院马拉松博物馆',
      latitude: 24.61722761,
      longitude: 118.06906354421486,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '德文厦门工学院马拉松博物馆',
        color: '#000',
        display: 'ALWAYS'
      }
    }, {
      id: 7,
      title: '工程坊',
      latitude: 24.61869385,
      longitude: 118.0689902590318,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '工程坊',
        color: '#000',
        display: 'ALWAYS'
      },

    }, {
      id: 8,
      title: '颐膳堂',
      latitude: 24.61607,
      longitude: 118.06372,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '颐膳堂',
        color: '#000',
        display: 'ALWAYS'
      },

    }, {
      id: 9,
      title: '和膳堂',
      latitude: 24.61647,
      longitude: 118.06410,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '和膳堂',
        color: '#000',
        display: 'ALWAYS'
      },

    }, {
      id: 10,
      title: '怡心园',
      latitude: 24.61727,
      longitude: 118.07012,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '怡心园',
        color: '#000',
        display: 'ALWAYS'
      },
    }, {
      id: 11,
      title: '国际学术交流中心',
      latitude: 24.61795,
      longitude: 118.07143,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '国际学术交流中心',
        color: '#000',
        display: 'ALWAYS'
      },

    },
    {
      id: 12,
      title: '标准化考试中心',
      latitude: 24.61457,
      longitude: 118.06219,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '标准化考试中心',
        color: '#000',
        display: 'ALWAYS'
      },
    },
    {
      id: 13,
      title: '春山商店',
      latitude: 24.61506,
      longitude: 118.06179,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '春山商店',
        color: '#000',
        display: 'ALWAYS'
      },

    }, {
      id: 14,
      title: '马拉松驿站',
      latitude: 24.61706,
      longitude: 118.07036,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '马拉松驿站',
        color: '#000',
        display: 'ALWAYS'
      },
    },
    {
      id: 15,
      title: '源缘美术馆',
      latitude: 24.61673,
      longitude: 118.06902,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '源缘美术馆',
        color: '#000',
        display: 'ALWAYS'
      },
    },
    {
      id: 16,
      title: '音乐艺术馆',
      latitude: 24.61622,
      longitude: 118.06729,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '音乐艺术馆',
        color: '#000',
        display: 'ALWAYS'
      },
    },
    {
      id: 17,
      title: '文化创意创作坊',
      latitude: 24.61522,
      longitude: 118.06601,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
      callout: { //可根据需求是否展示经纬度
        content: '文化创意创作坊',
        color: '#000',
        display: 'ALWAYS'
      },
    }
  ]
}]
const reRoute1 = [{
    latitude: 24.615637,
    longitude: 118.06537
  },
  {
    latitude: 24.615523,
    longitude: 118.06519
  },
  {
    latitude: 24.615523,
    longitude: 118.06519
  },
  {
    latitude: 24.615248,
    longitude: 118.064756
  },
  {
    latitude: 24.615263,
    longitude: 118.064729
  },
  {
    latitude: 24.615423999999997,
    longitude: 118.064609
  },
  {
    latitude: 24.615381,
    longitude: 118.06454
  },
  {
    latitude: 24.61541,
    longitude: 118.06451899999999
  },
  {
    latitude: 24.61541,
    longitude: 118.06451899999999
  },
  {
    latitude: 24.61539,
    longitude: 118.06448599999999
  },
  {
    latitude: 24.61539,
    longitude: 118.064486
  },
  {
    latitude: 24.615116,
    longitude: 118.064043
  },
  {
    latitude: 24.615116,
    longitude: 118.064043
  },
  {
    latitude: 24.615081,
    longitude: 118.063987
  },
  {
    latitude: 24.615081,
    longitude: 118.063987
  },
  {
    latitude: 24.614819,
    longitude: 118.063615
  },
  {
    latitude: 24.614819,
    longitude: 118.063615
  },
  {
    latitude: 24.614666,
    longitude: 118.063596
  },
  {
    latitude: 24.614643,
    longitude: 118.06358800000001
  },
  {
    latitude: 24.614613000000002,
    longitude: 118.06356600000001
  },
  {
    latitude: 24.614571,
    longitude: 118.06350200000001
  },
  {
    latitude: 24.614391,
    longitude: 118.06319700000002
  },
  {
    latitude: 24.614391,
    longitude: 118.063197
  },
  {
    latitude: 24.614274,
    longitude: 118.063001
  },
  {
    latitude: 24.614274,
    longitude: 118.063001
  },
  {
    latitude: 24.614410000000003,
    longitude: 118.063022
  },
  {
    latitude: 24.614422000000005,
    longitude: 118.06303100000001
  },
  {
    latitude: 24.614471000000005,
    longitude: 118.06309300000001
  },
  {
    latitude: 24.614471000000005,
    longitude: 118.06309300000001
  },
  {
    latitude: 24.614544000000006,
    longitude: 118.06318700000001
  },
  {
    latitude: 24.614544000000006,
    longitude: 118.06318700000001
  },
  {
    latitude: 24.614711000000007,
    longitude: 118.063049
  },
  {
    latitude: 24.614711000000007,
    longitude: 118.063049
  },
  {
    latitude: 24.615001000000007,
    longitude: 118.062809
  },
  {
    latitude: 24.615001000000007,
    longitude: 118.062809
  },
  {
    latitude: 24.615067000000007,
    longitude: 118.06276700000001
  },
  {
    latitude: 24.615067,
    longitude: 118.062767
  },
  {
    latitude: 24.615493999999998,
    longitude: 118.06249199999999
  },
  {
    latitude: 24.615493999999998,
    longitude: 118.06249199999999
  },
  {
    latitude: 24.615996,
    longitude: 118.063318
  },
  {
    latitude: 24.615996,
    longitude: 118.063318
  },
  {
    latitude: 24.616319,
    longitude: 118.063817
  },
  {
    latitude: 24.616319,
    longitude: 118.063817
  },
  {
    latitude: 24.616361,
    longitude: 118.063887
  },
  {
    latitude: 24.616361,
    longitude: 118.063887
  },
  {
    latitude: 24.61616,
    longitude: 118.064043
  },
  {
    latitude: 24.61616,
    longitude: 118.064043
  },
  {
    latitude: 24.615959,
    longitude: 118.064198
  },
  {
    latitude: 24.615959,
    longitude: 118.064198
  },
  {
    latitude: 24.615923,
    longitude: 118.06422500000001
  },
  {
    latitude: 24.615923,
    longitude: 118.064225
  },
  {
    latitude: 24.615865,
    longitude: 118.06427
  },
  {
    latitude: 24.615865,
    longitude: 118.06427
  },
  {
    latitude: 24.615501,
    longitude: 118.06455199999999
  },
  {
    latitude: 24.615501,
    longitude: 118.06455199999999
  },
  {
    latitude: 24.616072999999997,
    longitude: 118.06545
  },
  {
    latitude: 24.616072999999997,
    longitude: 118.06545
  },
  {
    latitude: 24.616164999999995,
    longitude: 118.065594
  },
  {
    latitude: 24.616165,
    longitude: 118.065594
  },
  {
    latitude: 24.616322,
    longitude: 118.065841
  },
  {
    latitude: 24.616322,
    longitude: 118.065841
  },
  {
    latitude: 24.616058,
    longitude: 118.066034
  },
  {
    latitude: 24.616058,
    longitude: 118.066034
  },
  {
    latitude: 24.615506999999997,
    longitude: 118.066487
  },
  {
    latitude: 24.615506999999997,
    longitude: 118.066487
  },
  {
    latitude: 24.615738999999998,
    longitude: 118.066897
  },
  {
    latitude: 24.615758999999997,
    longitude: 118.066942
  },
  {
    latitude: 24.615766999999998,
    longitude: 118.06697799999999
  },
  {
    latitude: 24.615765999999997,
    longitude: 118.066993
  },
  {
    latitude: 24.615760999999996,
    longitude: 118.06700699999999
  },
  {
    latitude: 24.615754999999996,
    longitude: 118.06701299999999
  },
  {
    latitude: 24.615756,
    longitude: 118.06711
  },
  {
    latitude: 24.616442000000003,
    longitude: 118.06819
  },
  {
    latitude: 24.616442000000003,
    longitude: 118.06819
  },
  {
    latitude: 24.617335000000004,
    longitude: 118.06956100000001
  },
  {
    latitude: 24.617335000000004,
    longitude: 118.06956100000001
  },
  {
    latitude: 24.617423000000006,
    longitude: 118.069489
  },
  {
    latitude: 24.617423,
    longitude: 118.069489
  },
  {
    latitude: 24.61781,
    longitude: 118.069174
  },
  {
    latitude: 24.61781,
    longitude: 118.069174
  },
  {
    latitude: 24.618183,
    longitude: 118.068929
  },
  {
    latitude: 24.618183,
    longitude: 118.068929
  },
  {
    latitude: 24.618176,
    longitude: 118.068917
  }
]
const reRoute2 = [{
    latitude: 24.615637,
    longitude: 118.06537
  },
  {
    latitude: 24.615523,
    longitude: 118.06519
  },
  {
    latitude: 24.615523,
    longitude: 118.06519
  },
  {
    latitude: 24.615248,
    longitude: 118.064756
  },
  {
    latitude: 24.615263,
    longitude: 118.064729
  },
  {
    latitude: 24.615423999999997,
    longitude: 118.064609
  },
  {
    latitude: 24.615381,
    longitude: 118.06454
  },
  {
    latitude: 24.61541,
    longitude: 118.06451899999999
  },
  {
    latitude: 24.61541,
    longitude: 118.064519
  },
  {
    latitude: 24.615823000000002,
    longitude: 118.064209
  },
  {
    latitude: 24.615823000000002,
    longitude: 118.064209
  },
  {
    latitude: 24.615910000000003,
    longitude: 118.064142
  },
  {
    latitude: 24.615910000000003,
    longitude: 118.064142
  },
  {
    latitude: 24.616035000000004,
    longitude: 118.064042
  },
  {
    latitude: 24.616035000000004,
    longitude: 118.064042
  },
  {
    latitude: 24.616319000000004,
    longitude: 118.063817
  },
  {
    latitude: 24.616319000000004,
    longitude: 118.063817
  },
  {
    latitude: 24.616215000000004,
    longitude: 118.063656
  },
  {
    latitude: 24.616215,
    longitude: 118.063655
  },
  {
    latitude: 24.615996,
    longitude: 118.063318
  },
  {
    latitude: 24.615996,
    longitude: 118.063318
  },
  {
    latitude: 24.615909,
    longitude: 118.06338199999999
  },
  {
    latitude: 24.615909,
    longitude: 118.06338199999999
  },
  {
    latitude: 24.615790999999998,
    longitude: 118.06346799999999
  },
  {
    latitude: 24.615791,
    longitude: 118.063468
  },
  {
    latitude: 24.615553000000002,
    longitude: 118.063641
  },
  {
    latitude: 24.615553000000002,
    longitude: 118.063641
  },
  {
    latitude: 24.615122000000003,
    longitude: 118.063957
  },
  {
    latitude: 24.615058,
    longitude: 118.063955
  },
  {
    latitude: 24.614819,
    longitude: 118.06361500000001
  },
  {
    latitude: 24.614819,
    longitude: 118.06361500000001
  },
  {
    latitude: 24.614666,
    longitude: 118.06359600000002
  },
  {
    latitude: 24.614643,
    longitude: 118.06358800000002
  },
  {
    latitude: 24.614613000000002,
    longitude: 118.06356600000002
  },
  {
    latitude: 24.614571,
    longitude: 118.06350200000003
  },
  {
    latitude: 24.614444000000002,
    longitude: 118.06328600000003
  },
  {
    latitude: 24.614444,
    longitude: 118.063286
  },
  {
    latitude: 24.614273999999998,
    longitude: 118.063001
  },
  {
    latitude: 24.614273999999998,
    longitude: 118.063001
  },
  {
    latitude: 24.61441,
    longitude: 118.063022
  },
  {
    latitude: 24.614422,
    longitude: 118.06303100000001
  },
  {
    latitude: 24.614471,
    longitude: 118.06309300000001
  },
  {
    latitude: 24.614471,
    longitude: 118.06309300000001
  },
  {
    latitude: 24.614544000000002,
    longitude: 118.06318700000001
  },
  {
    latitude: 24.614544000000002,
    longitude: 118.06318700000001
  },
  {
    latitude: 24.614711000000003,
    longitude: 118.063049
  },
  {
    latitude: 24.614711000000003,
    longitude: 118.063049
  },
  {
    latitude: 24.615001000000003,
    longitude: 118.062809
  },
  {
    latitude: 24.615001000000003,
    longitude: 118.062809
  },
  {
    latitude: 24.615007000000002,
    longitude: 118.062805
  },
  {
    latitude: 24.615007,
    longitude: 118.062805
  },
  {
    latitude: 24.615493999999998,
    longitude: 118.06249199999999
  },
  {
    latitude: 24.615493999999998,
    longitude: 118.06249199999999
  },
  {
    latitude: 24.615779,
    longitude: 118.06229599999999
  },
  {
    latitude: 24.615779,
    longitude: 118.062296
  },
  {
    latitude: 24.61583,
    longitude: 118.06226000000001
  },
  {
    latitude: 24.61583,
    longitude: 118.06226000000001
  },
  {
    latitude: 24.61666,
    longitude: 118.06355200000002
  },
  {
    latitude: 24.61666,
    longitude: 118.06355200000002
  },
  {
    latitude: 24.616712,
    longitude: 118.06362500000002
  },
  {
    latitude: 24.616712,
    longitude: 118.06362500000002
  },
  {
    latitude: 24.616986999999998,
    longitude: 118.06404200000001
  },
  {
    latitude: 24.616986999999998,
    longitude: 118.06404200000001
  },
  {
    latitude: 24.617058999999998,
    longitude: 118.06415100000001
  },
  {
    latitude: 24.617058999999998,
    longitude: 118.06415100000001
  },
  {
    latitude: 24.616860999999997,
    longitude: 118.06430600000002
  },
  {
    latitude: 24.616861,
    longitude: 118.064306
  },
  {
    latitude: 24.616211,
    longitude: 118.06481600000001
  },
  {
    latitude: 24.616211,
    longitude: 118.06481600000001
  },
  {
    latitude: 24.615865,
    longitude: 118.06427000000001
  },
  {
    latitude: 24.615865,
    longitude: 118.06427000000001
  },
  {
    latitude: 24.615501,
    longitude: 118.064552
  },
  {
    latitude: 24.615501,
    longitude: 118.064552
  },
  {
    latitude: 24.616072999999997,
    longitude: 118.06545000000001
  },
  {
    latitude: 24.616072999999997,
    longitude: 118.06545000000001
  },
  {
    latitude: 24.616321999999997,
    longitude: 118.065841
  },
  {
    latitude: 24.616321999999997,
    longitude: 118.065841
  },
  {
    latitude: 24.616337999999995,
    longitude: 118.065866
  },
  {
    latitude: 24.616338,
    longitude: 118.065866
  },
  {
    latitude: 24.616322,
    longitude: 118.065841
  },
  {
    latitude: 24.616322,
    longitude: 118.065841
  },
  {
    latitude: 24.616058,
    longitude: 118.066034
  },
  {
    latitude: 24.616058,
    longitude: 118.066034
  },
  {
    latitude: 24.615506999999997,
    longitude: 118.066487
  },
  {
    latitude: 24.615506999999997,
    longitude: 118.066487
  },
  {
    latitude: 24.615401999999996,
    longitude: 118.066575
  },
  {
    latitude: 24.615401999999996,
    longitude: 118.066575
  },
  {
    latitude: 24.615495999999997,
    longitude: 118.066709
  },
  {
    latitude: 24.615495999999997,
    longitude: 118.066709
  },
  {
    latitude: 24.615716999999997,
    longitude: 118.067047
  },
  {
    latitude: 24.615716999999997,
    longitude: 118.067047
  },
  {
    latitude: 24.616441999999996,
    longitude: 118.06819
  },
  {
    latitude: 24.616441999999996,
    longitude: 118.06819
  },
  {
    latitude: 24.616466999999997,
    longitude: 118.068228
  },
  {
    latitude: 24.616467,
    longitude: 118.068228
  },
  {
    latitude: 24.617335,
    longitude: 118.06956100000001
  },
  {
    latitude: 24.617335,
    longitude: 118.06956100000001
  },
  {
    latitude: 24.617810000000002,
    longitude: 118.069174
  },
  {
    latitude: 24.617810000000002,
    longitude: 118.069174
  },
  {
    latitude: 24.618183000000002,
    longitude: 118.068929
  },
  {
    latitude: 24.618183000000002,
    longitude: 118.068929
  },
  {
    latitude: 24.61842,
    longitude: 118.069268
  },
  {
    latitude: 24.61842,
    longitude: 118.069268
  },
  {
    latitude: 24.618553000000002,
    longitude: 118.06945999999999
  },
  {
    latitude: 24.618553000000002,
    longitude: 118.06945999999999
  },
  {
    latitude: 24.618545,
    longitude: 118.069666
  },
  {
    latitude: 24.618545,
    longitude: 118.069666
  },
  {
    latitude: 24.618594,
    longitude: 118.06981999999999
  },
  {
    latitude: 24.618594,
    longitude: 118.06981999999999
  },
  {
    latitude: 24.618357000000003,
    longitude: 118.06978199999999
  },
  {
    latitude: 24.618357000000003,
    longitude: 118.06978199999999
  },
  {
    latitude: 24.618192000000004,
    longitude: 118.06974399999999
  },
  {
    latitude: 24.618192000000004,
    longitude: 118.06974399999999
  },
  {
    latitude: 24.617662000000003,
    longitude: 118.06966299999999
  },
  {
    latitude: 24.617662000000003,
    longitude: 118.06966299999999
  },
  {
    latitude: 24.617636000000005,
    longitude: 118.069909
  },
  {
    latitude: 24.617636,
    longitude: 118.069909
  },
  {
    latitude: 24.617611,
    longitude: 118.070137
  },
  {
    latitude: 24.617611,
    longitude: 118.070137
  },
  {
    latitude: 24.618301,
    longitude: 118.07027000000001
  },
  {
    latitude: 24.618301,
    longitude: 118.07027000000001
  },
  {
    latitude: 24.618935,
    longitude: 118.07039400000001
  },
  {
    latitude: 24.618973,
    longitude: 118.07039900000001
  },
  {
    latitude: 24.618973,
    longitude: 118.07039900000001
  },
  {
    latitude: 24.618985000000002,
    longitude: 118.07039700000001
  },
  {
    latitude: 24.619011,
    longitude: 118.07038000000001
  },
  {
    latitude: 24.619019,
    longitude: 118.07037000000001
  },
  {
    latitude: 24.619061000000002,
    longitude: 118.07026700000002
  },
  {
    latitude: 24.619061000000002,
    longitude: 118.07026700000002
  },
  {
    latitude: 24.619097000000004,
    longitude: 118.07034100000001
  },
  {
    latitude: 24.619120000000002,
    longitude: 118.07039600000002
  },
  {
    latitude: 24.619143,
    longitude: 118.07047800000002
  },
  {
    latitude: 24.619145,
    longitude: 118.07049300000003
  },
  {
    latitude: 24.619145,
    longitude: 118.07061300000002
  },
  {
    latitude: 24.619139999999998,
    longitude: 118.07071800000003
  },
  {
    latitude: 24.619131999999997,
    longitude: 118.07081800000003
  },
  {
    latitude: 24.619132,
    longitude: 118.070818
  },
  {
    latitude: 24.619103,
    longitude: 118.071172
  },
  {
    latitude: 24.619103,
    longitude: 118.071172
  },
  {
    latitude: 24.618790999999998,
    longitude: 118.071323
  },
  {
    latitude: 24.618790999999998,
    longitude: 118.071323
  },
  {
    latitude: 24.618778999999996,
    longitude: 118.071323
  },
  {
    latitude: 24.618737999999997,
    longitude: 118.07130900000001
  },
  {
    latitude: 24.618689999999997,
    longitude: 118.07129700000002
  },
  {
    latitude: 24.617965999999996,
    longitude: 118.07115500000002
  },
]
//wjl 第三条路线
const reRoute3 = [{
    latitude: 24.615637,
    longitude: 118.06537
  },
  {
    latitude: 24.615523,
    longitude: 118.06519
  },
  {
    latitude: 24.615523,
    longitude: 118.06519
  },
  {
    latitude: 24.615248,
    longitude: 118.064756
  },
  {
    latitude: 24.615263,
    longitude: 118.064729
  },
  {
    latitude: 24.615423999999997,
    longitude: 118.064609
  },
  {
    latitude: 24.615381,
    longitude: 118.06454
  },
  {
    latitude: 24.61541,
    longitude: 118.06451899999999
  },
  {
    latitude: 24.61541,
    longitude: 118.064519
  },
  {
    latitude: 24.615823000000002,
    longitude: 118.064209
  },
  {
    latitude: 24.615823000000002,
    longitude: 118.064209
  },
  {
    latitude: 24.615910000000003,
    longitude: 118.064142
  },
  {
    latitude: 24.615910000000003,
    longitude: 118.064142
  },
  {
    latitude: 24.616035000000004,
    longitude: 118.064042
  },
  {
    latitude: 24.616035000000004,
    longitude: 118.064042
  },
  {
    latitude: 24.616319000000004,
    longitude: 118.063817
  },
  {
    latitude: 24.616319000000004,
    longitude: 118.063817
  },
  {
    latitude: 24.616215000000004,
    longitude: 118.063656
  },
  {
    latitude: 24.61549,
    longitude: 118.06251
  },
  {
    latitude: 24.6150,
    longitude: 118.06281
  },
  {
    latitude: 24.61470,
    longitude: 118.06307
  },
  {
    latitude: 24.61460,
    longitude: 118.06315
  },
  {
    latitude: 24.614596,
    longitude: 118.063144
  },
  {
    latitude: 24.614544,
    longitude: 118.063187
  },
  {
    latitude: 24.614544,
    longitude: 118.063187
  },
  {
    latitude: 24.614470999999998,
    longitude: 118.063093
  },
  {
    latitude: 24.614470999999998,
    longitude: 118.063093
  },
  {
    latitude: 24.614421999999998,
    longitude: 118.063031
  },
  {
    latitude: 24.614409999999996,
    longitude: 118.06302199999999
  },
  {
    latitude: 24.614273999999995,
    longitude: 118.06300099999999
  },
  {
    latitude: 24.614273999999995,
    longitude: 118.06300099999999
  },
  {
    latitude: 24.613443999999994,
    longitude: 118.06290099999998
  },
  {
    latitude: 24.613443999999994,
    longitude: 118.06290099999998
  },
  {
    latitude: 24.613494999999993,
    longitude: 118.06227099999998
  },
  {
    latitude: 24.613514999999992,
    longitude: 118.06213299999997
  },
  {
    latitude: 24.613522999999994,
    longitude: 118.06209999999997
  },
  {
    latitude: 24.613560999999994,
    longitude: 118.06199199999998
  },
  {
    latitude: 24.613563999999993,
    longitude: 118.06198399999998
  },
  {
    latitude: 24.613564,
    longitude: 118.061984
  },
  {
    latitude: 24.61361,
    longitude: 118.06188
  },
  {
    latitude: 24.613948,
    longitude: 118.06122500000001
  },
  {
    latitude: 24.613969,
    longitude: 118.06119500000001
  },
  {
    latitude: 24.614055,
    longitude: 118.06109400000001
  },
  {
    latitude: 24.614084000000002,
    longitude: 118.061063
  },
  {
    latitude: 24.614220000000003,
    longitude: 118.06093700000001
  },
  {
    latitude: 24.614443,
    longitude: 118.06074100000001
  },
  {
    latitude: 24.61447,
    longitude: 118.06072700000001
  },
  {
    latitude: 24.614595,
    longitude: 118.06068500000002
  },
  {
    latitude: 24.614641000000002,
    longitude: 118.06067300000002
  },
  {
    latitude: 24.614652000000003,
    longitude: 118.06067200000003
  },
  {
    latitude: 24.614707000000003,
    longitude: 118.06068700000003
  },
  {
    latitude: 24.614745,
    longitude: 118.060697
  },
  {
    latitude: 24.614848,
    longitude: 118.060805
  },
  {
    latitude: 24.614863999999997,
    longitude: 118.060827
  },
  {
    latitude: 24.615259999999996,
    longitude: 118.06140500000001
  },
  {
    latitude: 24.615259999999996,
    longitude: 118.06140500000001
  },
  {
    latitude: 24.615322999999997,
    longitude: 118.06150000000001
  },
  {
    latitude: 24.615322999999997,
    longitude: 118.06150000000001
  },
  {
    latitude: 24.615829999999995,
    longitude: 118.06226000000001
  },
  {
    latitude: 24.615829999999995,
    longitude: 118.06226000000001
  },
  {
    latitude: 24.616659999999996,
    longitude: 118.06355200000002
  },
  {
    latitude: 24.616659999999996,
    longitude: 118.06355200000002
  },
  {
    latitude: 24.616711999999996,
    longitude: 118.06362500000002
  },
  {
    latitude: 24.616711999999996,
    longitude: 118.06362500000002
  },
  {
    latitude: 24.616986999999995,
    longitude: 118.06404200000001
  },
  {
    latitude: 24.616986999999995,
    longitude: 118.06404200000001
  },
  {
    latitude: 24.617058999999994,
    longitude: 118.06415100000001
  },
  {
    latitude: 24.617058999999994,
    longitude: 118.06415100000001
  },
  {
    latitude: 24.617059,
    longitude: 118.064151
  },
  {
    latitude: 24.616211,
    longitude: 118.064816
  },
  {
    latitude: 24.616211,
    longitude: 118.064816
  },
  {
    latitude: 24.616429,
    longitude: 118.06513
  },
  {
    latitude: 24.616429,
    longitude: 118.06513
  },
  {
    latitude: 24.616735,
    longitude: 118.065614
  },

  {
    latitude: 24.61628,
    longitude: 118.06588
  },
  {
    latitude: 24.616058,
    longitude: 118.066034
  },
  {
    latitude: 24.616058,
    longitude: 118.066034
  },
  {
    latitude: 24.615506999999997,
    longitude: 118.066487
  },
  {
    latitude: 24.615506999999997,
    longitude: 118.066487
  },
  {
    latitude: 24.615401999999996,
    longitude: 118.066575
  },
  {
    latitude: 24.615401999999996,
    longitude: 118.066575
  },
  {
    latitude: 24.615495999999997,
    longitude: 118.066709
  },
  {
    latitude: 24.615495999999997,
    longitude: 118.066709
  },
  {
    latitude: 24.615716999999997,
    longitude: 118.067047
  },
  {
    latitude: 24.615716999999997,
    longitude: 118.067047
  },
  {
    latitude: 24.616441999999996,
    longitude: 118.06819
  },
  {
    latitude: 24.616441999999996,
    longitude: 118.06819
  },
  {
    latitude: 24.616466999999997,
    longitude: 118.068228
  },

  {
    latitude: 24.616467,
    longitude: 118.068228
  },
  {
    latitude: 24.617335,
    longitude: 118.06956100000001
  },
  {
    latitude: 24.617335,
    longitude: 118.06956100000001
  },
  {
    latitude: 24.617810000000002,
    longitude: 118.069174
  },
  {
    latitude: 24.617810000000002,
    longitude: 118.069174
  },
  {
    latitude: 24.618183000000002,
    longitude: 118.068929
  },
  {
    latitude: 24.618183000000002,
    longitude: 118.068929
  },
  {
    latitude: 24.61842,
    longitude: 118.069268
  },

  {
    latitude: 24.61842,
    longitude: 118.069268
  },
  {
    latitude: 24.618553000000002,
    longitude: 118.06945999999999
  },
  {
    latitude: 24.618553000000002,
    longitude: 118.06945999999999
  },
  {
    latitude: 24.618545,
    longitude: 118.069666
  },
  {
    latitude: 24.618545,
    longitude: 118.069666
  },
  {
    latitude: 24.618594,
    longitude: 118.06981999999999
  },
  {
    latitude: 24.618594,
    longitude: 118.06981999999999
  },
  {
    latitude: 24.618357000000003,
    longitude: 118.06978199999999
  },
  {
    latitude: 24.618357000000003,
    longitude: 118.06978199999999
  },
  {
    latitude: 24.618192000000004,
    longitude: 118.06974399999999
  },
  {
    latitude: 24.618192000000004,
    longitude: 118.06974399999999
  },
  {
    latitude: 24.617662000000003,
    longitude: 118.06966299999999
  },
  {
    latitude: 24.617662000000003,
    longitude: 118.06966299999999
  },
  {
    latitude: 24.617636000000005,
    longitude: 118.069909
  },

  {
    latitude: 24.617636,
    longitude: 118.069909
  },
  {
    latitude: 24.617611,
    longitude: 118.070137
  },
  {
    latitude: 24.617611,
    longitude: 118.070137
  },
  {
    latitude: 24.618301,
    longitude: 118.07027000000001
  },
  {
    latitude: 24.618301,
    longitude: 118.07027000000001
  },
  {
    latitude: 24.618935,
    longitude: 118.07039400000001
  },
  {
    latitude: 24.618973,
    longitude: 118.07039900000001
  },
  {
    latitude: 24.618973,
    longitude: 118.07039900000001
  },
  {
    latitude: 24.618985000000002,
    longitude: 118.07039700000001
  },
  {
    latitude: 24.619011,
    longitude: 118.07038000000001
  },
  {
    latitude: 24.619019,
    longitude: 118.07037000000001
  },
  {
    latitude: 24.619061000000002,
    longitude: 118.07026700000002
  },
  {
    latitude: 24.619061000000002,
    longitude: 118.07026700000002
  },
  {
    latitude: 24.619097000000004,
    longitude: 118.07034100000001
  },
  {
    latitude: 24.619120000000002,
    longitude: 118.07039600000002
  },
  {
    latitude: 24.619143,
    longitude: 118.07047800000002
  },
  {
    latitude: 24.619145,
    longitude: 118.07049300000003
  },
  {
    latitude: 24.619145,
    longitude: 118.07061300000002
  },
  {
    latitude: 24.619139999999998,
    longitude: 118.07071800000003
  },
  {
    latitude: 24.619131999999997,
    longitude: 118.07081800000003
  },
  {
    latitude: 24.619132,
    longitude: 118.070818
  },
  {
    latitude: 24.619103,
    longitude: 118.071172
  },
  {
    latitude: 24.619103,
    longitude: 118.071172
  },
  {
    latitude: 24.618790999999998,
    longitude: 118.071323
  },
  {
    latitude: 24.618790999999998,
    longitude: 118.071323
  },
  {
    latitude: 24.618778999999996,
    longitude: 118.071323
  },
  {
    latitude: 24.618737999999997,
    longitude: 118.07130900000001
  },
  {
    latitude: 24.618689999999997,
    longitude: 118.07129700000002
  },
  {
    latitude: 24.617965999999996,
    longitude: 118.07115500000002
  },

]
//wjl 定位用 除了路线之外的全部
var markersDatas = {
  "场馆": [{
      id: 0,
      title: '图书馆',
      latitude: 24.6153,
      longitude: 118.06563,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,
    },
    {
      id: 1,
      title: '校史馆',
      latitude: 24.61702761,
      longitude: 118.0687635442148,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,

    },
    {
      id: 2,
      title: '教育博物馆',
      latitude: 24.61692402680608,
      longitude: 118.06537247380989,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,

    },
    {
      id: 3,
      title: '德文厦门工学院马拉松博物馆',
      latitude: 24.6172276,
      longitude: 118.06906354,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,

    },
    {
      id: 4,
      title: '教育信息文化馆',
      latitude: 24.615393,
      longitude: 118.0652902590318,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,

    },
    {
      id: 5,
      title: '工程文化馆',
      latitude: 24.61869385,
      longitude: 118.0689902590318,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,

    },
    {
      id: 6,
      title: '体育文化馆',
      latitude: 24.613867,
      longitude: 118.063237,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,

    },
    {
      id: 7,
      title: '源缘美术馆',
      latitude: 24.61662656,
      longitude: 118.06889025322272,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,

    },
    {
      id: 8,
      title: '射艺馆',
      latitude: 24.613668681,
      longitude: 118.0649366148524,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20,

    },
    {
      id: 9,
      title: '音乐艺术馆',
      latitude: 24.616185,
      longitude: 118.067326,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20

    },
    {
      id: 10,
      title: '弘本书馆',
      latitude: 24.616069,
      longitude: 118.06794,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20

    },
    {
      id: 11,
      title: '标准化考试中心',
      latitude: 24.614571389,
      longitude: 118.0622101494354,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20

    },
    {
      id: 12,
      title: '国际钢琴艺术交流中心',
      latitude: 24.61669357,
      longitude: 118.06820546931748,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20
    }
  ],
  "园林": [{
    id: 0,
    title: '至未园',
    latitude: 24.61607913,
    longitude: 118.06645742733785,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 1,
    title: '卓尔园',
    latitude: 24.61569385,
    longitude: 118.0649902590318,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 2,
    title: '天工园',
    latitude: 24.61732761,
    longitude: 118.06866354421486,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 3,
    title: '天鹭园',
    latitude: 24.61732761,
    longitude: 118.06866354421486,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 4,
    title: '百树园',
    latitude: 24.6166265621,
    longitude: 118.06729025322272,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 5,
    title: '同舟园',
    latitude: 24.61813594566,
    longitude: 118.06938237621853,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 6,
    title: '校友园',
    latitude: 24.61813594566,
    longitude: 118.06938237621853,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 7,
    title: '问津园',
    latitude: 24.614472184419,
    longitude: 118.06691742617602,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 8,
    title: '汲善园',
    latitude: 24.6150927758,
    longitude: 118.06726074892406,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 9,
    title: '栖仁园',
    latitude: 24.61447218441999,
    longitude: 118.06691742617602,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }],

  "建筑楼": [{
    id: 0,
    title: '至善大厦',
    latitude: 24.6147599,
    longitude: 118.06655398686071,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 1,
    title: '政务大厦',
    latitude: 24.6150025,
    longitude: 118.06527591428699,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 2,
    title: '厚德大厦',
    latitude: 24.6158669,
    longitude: 118.06474215470216,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 3,
    title: '怀德大厦',
    latitude: 24.6168886,
    longitude: 118.06619591196335,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 4,
    title: '诚意大厦',
    latitude: 24.6160523,
    longitude: 118.06229866233139,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 5,
    title: '正心大厦',
    latitude: 24.616069,
    longitude: 118.06794,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 6,
    title: '日新大厦',
    latitude: 24.6168667,
    longitude: 118.06516728482374,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 7,
    title: '博雅大厦',
    latitude: 24.6167814,
    longitude: 118.06825853066053,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 8,
    title: '明德大厦',
    latitude: 24.6163388,
    longitude: 118.06881240681263,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 9,
    title: '工程坊',
    latitude: 24.6183310,
    longitude: 118.06854820922916,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }],
  //学院
  "学院": [{
    id: 0,
    title: '机械电气与信息工程学院',
    latitude: 24.6170740,
    longitude: 118.06937030627816,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 1,
    title: '建筑科学与土木工程学院',
    latitude: 24.6165290,
    longitude: 118.06475690685149,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 2,
    title: '博雅教育与艺术传媒学院',
    latitude: 24.6166277,
    longitude: 118.06800774412193,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 3,
    title: '商学院',
    latitude: 24.6161230,
    longitude: 118.06809759812238,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 4,
    title: '外国语学院',
    latitude: 24.61662168,
    longitude: 118.0689800448732,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 5,
    title: '数据科学与计算机学院',
    latitude: 24.61581821,
    longitude: 118.0681230791076,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 6,
    title: '国际教育学院',
    latitude: 24.61662168,
    longitude: 118.0689800448732,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 7,
    title: '国学院',
    latitude: 24.61559509,
    longitude: 118.0675329931344,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 8,
    title: '体育部',
    latitude: 24.6139149,
    longitude: 118.06319049681359,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 9,
    title: '思想政治理论课教学部',
    latitude: 24.61559509,
    longitude: 118.0675329931344,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 10,
    title: '研究生辅考学院',
    latitude: 24.6154695,
    longitude: 118.06596121867857,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 11,
    title: '继续教育学院',
    latitude: 24.6165436,
    longitude: 118.06326425756023,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 12,
    title: '教师进修学院',
    latitude: 24.61559509,
    longitude: 118.0675329931344,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 13,
    title: '学研产企业学院',
    latitude: 24.616699715277576,
    longitude: 118.06341446126248,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }],
  //书院
  "书院": [{
    id: 0,
    title: '友爱书院',
    latitude: 24.6162839,
    longitude: 118.06333265388895,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 1,
    title: '友达书院',
    latitude: 24.6155426,
    longitude: 118.06312344158935,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 2,
    title: '友敏书院',
    latitude: 24.6154561,
    longitude: 118.06217259850986,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 3,
    title: '友恭书院',
    latitude: 24.6150574,
    longitude: 118.06244484272021,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 4,
    title: '友惠书院',
    latitude: 24.6150574,
    longitude: 118.06244484272021,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 5,
    title: '友仁书院',
    latitude: 24.61589259,
    longitude: 118.0626017519449,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 6,
    title: '友善书院',
    latitude: 24.61467823,
    longitude: 118.0627224513485,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 7,
    title: '友容书院',
    latitude: 24.61467823,
    longitude: 118.0627224513485,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }],
  //餐饮
  "餐饮": [{
    id: 0,
    title: '颐膳堂',
    latitude: 24.6156962,
    longitude: 118.06388384783209,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 1,
    title: '和膳堂',
    latitude: 24.6164339,
    longitude: 118.06425667487876,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 2,
    title: '原山餐厅',
    latitude: 24.6184590,
    longitude: 118.07156301211033,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 3,
    title: '必胜客',
    latitude: 24.6156962,
    longitude: 118.06388384783209,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 4,
    title: '肯德基',
    latitude: 24.6164339,
    longitude: 118.06425667487876,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }],
  //停车场
  "停车场": [{
      id: 0,
      title: '二号门停车场',
      latitude: 24.61727152,
      longitude: 118.0710828967049,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20
    },
    {
      id: 1,
      title: '四号门停车场',
      latitude: 24.6143197,
      longitude: 118.06119493334064,
      iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
      width: 20,
      height: 20
    }
  ],
  //其它服务
  "其它服务": [{
    id: 0,
    title: '超市',
    latitude: 24.6158901,
    longitude: 118.06304163421581,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 1,
    title: '健康',
    latitude: 24.6158840,
    longitude: 118.06260309304936,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 2,
    title: '商业街',
    latitude: 24.6157901,
    longitude: 118.06294163421581,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 3,
    title: '国际学术交流中心',
    latitude: 24.6179030,
    longitude: 118.07145170043813,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 4,
    title: '春山系列',
    latitude: 24.6150964,
    longitude: 118.06190571871743,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 5,
    title: '厦工体育',
    latitude: 24.6138930,
    longitude: 118.06320659006741,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }, {
    id: 6,
    title: '驾校',
    latitude: 24.6139235,
    longitude: 118.06217259850986,
    iconPath: 'https://xit-edu.cn/oss/appointMiniImg/position_icon.png',
    width: 20,
    height: 20
  }]
}